<template>
  <h1>MyArticle</h1>
  <h3>{{ $route.query.name }}</h3>
  <h3>{{ $route.query.keyword }}</h3>
</template>

<script>
import {useRoute, useRouter} from 'vue-router'
import {ref, watch} from 'vue'

export default {
  name: "MyArticle",
  //setup只执行一次
  setup() {
    //不能用$route，因为没有this
    const route = useRoute()
    const router = useRouter()
    console.log(route.query.name, route.query.keyword)
  },
  computed: {
    pid() {
      return this.$route.params.id;
    }
  }
}
</script>

<style scoped>

</style>
